const publicReq = require.context('@/assets/icons/svg/publicSvg', false, /\.svg$/)
const businessReq = require.context('@/assets/icons/svg/businessSvg', false, /\.svg$/)
const commonReq = require.context('@/assets/icons/svg/commonSvg', false, /\.svg$/)

const requireAll = requireContext => requireContext.keys()

const re = /\.\/(.*)\.svg/
const iconsPublicReq = requireAll(publicReq).map(i => {
  return i.match(re)[1]
})
const iconsBusinessReq = requireAll(businessReq).map(i => {
  return i.match(re)[1]
})
const iconsCommonReq = requireAll(commonReq).map(i => {
  return i.match(re)[1]
})
const icons = [...iconsPublicReq, ...iconsBusinessReq, ...iconsCommonReq]
export default icons
